package com.ep.framelibrary.mvp;

import com.ep.framelibrary.FrameActivity;

/**
 * Created by Administrator on 2017/7/4.
 */

public abstract class FrameMvpActivity<P extends BasePresent> extends FrameActivity {
    protected P mPresent;

    @Override
    protected void initBeforeView() {
        mPresent=createPresent();
        mPresent.attach((IBaseView) this);
    }

    protected abstract P createPresent();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mPresent.detach((IBaseView) this);
    }
}
